package main

import (
	"fmt"
)

// make切片
func main() {
	var slice []string = make([]string, 5, 10)
	fmt.Println(slice)
	slice[1] = "hwang"
	slice[3] = "ice"
	modify(slice) //引用类型
	fmt.Println(slice)
	fmt.Println(slice[0])
	fmt.Printf("%p \n", &slice[0])
	fmt.Printf("%p \n", &slice)

	var strSlice []string = []string{"tom", "jerry", "marry"}
	fmt.Println(strSlice)
	fmt.Println(len(strSlice))
	fmt.Println(cap(strSlice))
}

func modify(slice []string) {
	slice[1] = "hwww"
}
